#include <gmlib/sm2/internal/sm2p256v1.h>
#include <stdexcept>
#include <cstring>

using namespace sm2::internal;

void test_sm2_fp_sqr()
{
    sm2_fp_t    a, c;
    std::uint8_t c_data[32];

    static std::uint8_t a0[32] = {0x47,0xf1,0xc1,0x0b,0xd7,0x46,0xdd,0xb1,0x3f,0xbc,0x9f,0x29,0xe9,0xe2,0xe6,0xa5,0x14,0x33,0x7d,0x97,0xb3,0x84,0x38,0x2e,0xbe,0xbe,0x02,0xb6,0xc2,0x60,0xc6,0xff};
    static std::uint8_t c0[32] = {0x3c,0x08,0xce,0xf0,0x66,0x7f,0xe5,0x8f,0x07,0x36,0xb5,0x5f,0x99,0x98,0xa5,0x0c,0xed,0xa9,0x57,0x2c,0x3f,0x5c,0x72,0xb6,0x38,0x32,0x5b,0xcc,0x35,0xa0,0x47,0x53};
    sm2_fp_from_bytes(a, a0);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c0, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a1[32] = {0xda,0x73,0x9f,0x05,0x65,0xec,0x28,0x55,0x88,0x48,0x1a,0x16,0xa5,0x6c,0x47,0xb1,0x41,0xdc,0x67,0x37,0xdb,0x1d,0xfd,0xc3,0x2f,0x7b,0xa1,0xb5,0xd3,0xc4,0x75,0xde};
    static std::uint8_t c1[32] = {0x9b,0xfb,0xe1,0x03,0xf4,0x34,0x55,0x86,0xd9,0x33,0xf6,0xa2,0x8e,0x23,0x6c,0x7c,0xe6,0xd6,0x7a,0x29,0xb8,0x58,0x90,0x7a,0x8c,0x78,0x07,0xf1,0x4a,0xdd,0xf3,0x49};
    sm2_fp_from_bytes(a, a1);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c1, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a2[32] = {0x7b,0x5a,0xa2,0xb9,0x27,0x19,0xa3,0x37,0x57,0xb5,0xdf,0x37,0xaf,0x76,0xd2,0x6c,0xc8,0xfc,0x66,0x9f,0xf6,0x34,0x5b,0x9e,0x2b,0x8f,0xe0,0xb2,0xff,0xf0,0x8e,0x5c};
    static std::uint8_t c2[32] = {0xde,0xdd,0xd0,0x41,0xd4,0xb3,0x7e,0x6f,0xb5,0x7d,0x81,0xc9,0x6d,0xff,0x68,0xbb,0xc8,0x72,0x39,0x3c,0x7b,0xf9,0xa4,0x1d,0x29,0xe7,0x72,0xe2,0xb2,0x55,0xd9,0x8a};
    sm2_fp_from_bytes(a, a2);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c2, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a3[32] = {0xbd,0xce,0xcd,0x2d,0xdb,0xc4,0xd4,0xe3,0x3e,0x03,0x51,0x77,0x7c,0x5f,0x51,0x96,0x4d,0x26,0xd3,0x51,0x38,0xbf,0x2d,0x85,0xe2,0xa7,0x1b,0x0c,0x50,0xa1,0x13,0xed};
    static std::uint8_t c3[32] = {0x41,0xa8,0xed,0x39,0x86,0xe9,0xf3,0x64,0x77,0x00,0x27,0x35,0x85,0xf3,0xaa,0x17,0x1a,0x3b,0xfe,0xa8,0x54,0xa3,0xe7,0xde,0x8d,0x40,0xdc,0xbe,0xfa,0xc8,0x38,0x34};
    sm2_fp_from_bytes(a, a3);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c3, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a4[32] = {0x73,0x78,0x78,0xd3,0x2a,0xe6,0x2e,0xf0,0x74,0xb7,0xfb,0x90,0x98,0xbd,0x5c,0x8a,0xd6,0x8a,0x0a,0x9c,0x7e,0x5e,0x1a,0x18,0x5f,0x09,0x60,0xa3,0x70,0xfc,0xa6,0xa7};
    static std::uint8_t c4[32] = {0x24,0x2c,0x93,0xb7,0xc9,0x41,0xf8,0x02,0x62,0x0a,0xcf,0xb3,0xe9,0x9b,0x25,0xc0,0x36,0xca,0xcf,0x00,0xae,0x60,0x7d,0x4b,0x67,0xb3,0x4a,0xb9,0xa0,0xbd,0x2a,0xd1};
    sm2_fp_from_bytes(a, a4);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c4, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a5[32] = {0x94,0xd0,0xef,0x2f,0x99,0xb0,0x6c,0xb5,0x6f,0xdf,0x5a,0x4d,0xa8,0x71,0x51,0x02,0x4b,0xf5,0x7f,0x25,0x97,0x65,0x92,0x41,0x80,0x9a,0x9c,0xe1,0x9e,0x28,0x79,0xc7};
    static std::uint8_t c5[32] = {0x9d,0xb0,0x41,0xa9,0x02,0x38,0x84,0xc2,0x03,0x12,0x86,0x10,0xb4,0x5b,0x68,0xc7,0x59,0x34,0x80,0x33,0x5d,0xce,0x58,0x91,0x15,0x48,0x4b,0x5a,0x5e,0x27,0x6c,0x72};
    sm2_fp_from_bytes(a, a5);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c5, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a6[32] = {0x01,0x28,0x26,0xce,0x55,0x09,0x4d,0x84,0xe3,0xbb,0xb4,0x0e,0xd7,0x10,0x60,0xbd,0x02,0x98,0x1f,0x3a,0x08,0xa4,0x6c,0xd4,0x8a,0xf6,0x20,0x37,0x52,0xb6,0x51,0x39};
    static std::uint8_t c6[32] = {0xa8,0xf3,0x2b,0x40,0x3d,0x63,0x14,0x19,0x53,0x46,0x82,0xd4,0x61,0x7c,0x03,0x5f,0x05,0xda,0xaf,0x1e,0xe4,0x4c,0x3e,0x63,0xec,0x2f,0xae,0xe0,0x86,0xb0,0x9b,0xea};
    sm2_fp_from_bytes(a, a6);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c6, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a7[32] = {0x2c,0xe0,0xe4,0xd3,0x3f,0xa3,0x10,0x95,0xf7,0xbb,0xdb,0x45,0xfc,0xa7,0xdf,0x75,0x21,0xfa,0x71,0xd1,0x85,0xed,0x74,0x82,0x61,0x88,0x50,0xa5,0xe9,0x14,0x7d,0x39};
    static std::uint8_t c7[32] = {0xc9,0x4e,0xcf,0xc1,0xb0,0xe8,0x67,0x2b,0x8e,0x2a,0x95,0xd5,0x58,0x55,0xd4,0x7a,0x7c,0x10,0x65,0xd5,0x97,0x63,0xd6,0x03,0x22,0x8f,0x23,0x76,0x8d,0xeb,0xbf,0xfe};
    sm2_fp_from_bytes(a, a7);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c7, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a8[32] = {0x93,0x7d,0x1b,0xde,0xa3,0x38,0xf4,0xef,0xdf,0x31,0x29,0x51,0x23,0x33,0xf3,0x26,0x7a,0xe8,0x10,0x14,0xc6,0x5d,0x58,0x4e,0x7d,0x18,0xe5,0x10,0xf7,0xcb,0xbe,0xe5};
    static std::uint8_t c8[32] = {0x7e,0xac,0xf0,0xe2,0xce,0xdf,0x07,0xb7,0x53,0x2b,0x19,0x3e,0x22,0x91,0x39,0xc1,0x34,0x54,0xca,0xb5,0xa5,0xa1,0x69,0x08,0xdd,0x35,0xb9,0xf2,0x78,0x63,0x2c,0x8c};
    sm2_fp_from_bytes(a, a8);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c8, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a9[32] = {0xa2,0xa4,0x63,0x62,0xd6,0x3f,0x0f,0x9d,0x1e,0x3a,0x5b,0x5a,0x8d,0x0f,0x07,0x13,0xa9,0x3f,0xe6,0x8f,0x3b,0x77,0xac,0x33,0x96,0x2e,0x94,0xeb,0x7f,0xb9,0x0c,0xff};
    static std::uint8_t c9[32] = {0xca,0x3d,0xc5,0xf9,0x12,0xef,0x1f,0xa1,0x6f,0xbe,0x82,0xfd,0xc9,0x75,0x11,0xe2,0xb7,0xf6,0x36,0xfc,0x3d,0x1d,0xbd,0x3b,0x46,0xea,0xa0,0xf7,0x07,0x83,0x8f,0x0f};
    sm2_fp_from_bytes(a, a9);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c9, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a10[32] = {0xa2,0x3e,0xc1,0x6d,0xae,0x10,0x14,0x4e,0x3a,0x02,0xe6,0xcd,0xc5,0x7e,0xd5,0x5d,0x22,0xd5,0x71,0x26,0xc6,0x72,0xfd,0x22,0xf9,0x29,0x38,0xb1,0xa2,0x42,0xf7,0x84};
    static std::uint8_t c10[32] = {0x68,0x0e,0xa6,0x84,0x16,0x98,0x3b,0x87,0x64,0xb4,0x6a,0x0a,0xc7,0x00,0x22,0x78,0x81,0x0c,0x2e,0x3a,0x94,0x45,0x8f,0xd6,0x52,0x54,0x8c,0x5d,0xfd,0x27,0xf0,0xb7};
    sm2_fp_from_bytes(a, a10);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c10, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a11[32] = {0xdb,0x59,0x60,0xaf,0xd2,0x20,0x42,0x98,0x03,0x7d,0xa5,0x12,0xde,0x85,0xdb,0xd1,0xff,0xf8,0x48,0x38,0x4c,0xfc,0xc3,0x65,0xf1,0xde,0xe5,0xe6,0x27,0xb5,0xa1,0x76};
    static std::uint8_t c11[32] = {0xfa,0x0d,0xbc,0x20,0x09,0x56,0x1b,0x90,0xdc,0xeb,0x4f,0x8b,0x81,0xe9,0x17,0xc9,0xbd,0x63,0xbe,0x84,0xcf,0x81,0x63,0xcc,0x42,0x77,0x3d,0xb6,0x89,0x5b,0xa5,0x44};
    sm2_fp_from_bytes(a, a11);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c11, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a12[32] = {0x8e,0xe5,0x72,0x19,0x14,0x61,0x2c,0xba,0xb0,0xde,0x6d,0x94,0x9e,0x0d,0xa7,0xb8,0x52,0x74,0x32,0x4a,0x3d,0xcf,0xdd,0x4d,0x09,0x80,0x09,0x9f,0x40,0x53,0x08,0xec};
    static std::uint8_t c12[32] = {0x73,0xc1,0x2c,0xc6,0x5f,0x12,0x96,0x29,0x6d,0xfb,0xc3,0xf5,0xb2,0x55,0x0b,0x8e,0xbc,0xf8,0xa4,0x6b,0x73,0xa5,0xc5,0x7c,0x47,0xf1,0x05,0xc8,0xc7,0x27,0x36,0x33};
    sm2_fp_from_bytes(a, a12);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c12, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a13[32] = {0xce,0x60,0xf9,0xf9,0x9f,0x12,0x81,0x1f,0x8f,0x43,0xd8,0xb4,0xb0,0x7c,0xf5,0x34,0xc3,0xdf,0x99,0x20,0xc0,0x75,0xf2,0x35,0xbb,0xdd,0xc4,0x62,0x04,0x82,0xda,0xcb};
    static std::uint8_t c13[32] = {0x49,0xe1,0x47,0x1d,0x7a,0x51,0xc1,0xce,0xfe,0xee,0x43,0xb7,0xa5,0x6e,0xc9,0xdf,0xba,0xb8,0xca,0x5d,0x77,0x24,0x96,0x08,0x7e,0x19,0xb5,0x45,0xcb,0xd8,0x4f,0xe0};
    sm2_fp_from_bytes(a, a13);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c13, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a14[32] = {0x40,0x0f,0x0c,0x28,0x83,0xa5,0xd9,0x1a,0xc3,0x05,0xe0,0x90,0x6d,0xde,0x98,0x93,0x6d,0x40,0x9d,0x29,0x77,0xd4,0xe2,0x5c,0x7e,0x41,0xa1,0x92,0x82,0x82,0x8f,0xca};
    static std::uint8_t c14[32] = {0x0b,0x8b,0x8e,0xd8,0x62,0x55,0xbf,0xfa,0xff,0xc1,0x4a,0x2d,0x87,0x52,0x93,0xa9,0x65,0x09,0x18,0x8c,0x56,0x35,0xe5,0x9e,0xb7,0x32,0xe7,0x99,0x1b,0xd6,0x57,0x47};
    sm2_fp_from_bytes(a, a14);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c14, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a15[32] = {0x7e,0x9f,0x18,0xd4,0xb0,0xc3,0xbd,0x8a,0x21,0xf6,0x95,0x83,0x40,0x5d,0xea,0xfc,0x7c,0xb3,0xd9,0x01,0x07,0xbb,0xf2,0xf3,0x10,0xc8,0xa4,0x3e,0x56,0x5e,0xb7,0xa3};
    static std::uint8_t c15[32] = {0x41,0x7f,0x26,0x40,0x79,0x0e,0x8a,0x25,0x84,0x19,0xa6,0x50,0x62,0x16,0x50,0x2f,0x19,0x82,0x54,0xd5,0x49,0xca,0x78,0xd0,0xdb,0x2f,0xb3,0x3f,0x9a,0xdf,0x42,0xd8};
    sm2_fp_from_bytes(a, a15);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c15, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a16[32] = {0xcc,0x6c,0x1a,0x5d,0xe5,0x96,0x94,0x20,0x5d,0x17,0x9f,0xef,0x2d,0xcf,0x18,0xe5,0xf6,0x96,0x2c,0x4f,0x0c,0x04,0xbb,0xf9,0x39,0xb8,0x47,0x0f,0xff,0xb4,0x54,0x0d};
    static std::uint8_t c16[32] = {0x28,0x7c,0xf3,0x80,0x95,0x87,0xa6,0x07,0x0e,0x0e,0x6b,0x44,0xa8,0xb7,0xe1,0x6c,0xe1,0x24,0x00,0xfc,0xf3,0xfb,0x06,0x8a,0xb3,0xab,0x19,0xb0,0x03,0x59,0x80,0x2f};
    sm2_fp_from_bytes(a, a16);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c16, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a17[32] = {0xd5,0x7e,0x3a,0xe0,0x4c,0x5e,0x39,0x89,0x55,0xbe,0x78,0x01,0x97,0xd0,0xaf,0x11,0xe6,0x79,0x99,0x92,0x3e,0xfc,0x5e,0x6d,0xa6,0xc8,0x6d,0xf4,0xe4,0xeb,0x08,0x78};
    static std::uint8_t c17[32] = {0xc9,0xde,0xd4,0x45,0xcd,0x33,0xdd,0x4f,0x3d,0x73,0x92,0x4e,0x2f,0xe9,0xa2,0xa6,0x55,0xde,0x54,0xe4,0x0c,0xda,0x67,0x3e,0x2c,0x22,0x0e,0x7a,0x89,0xba,0x5e,0xd1};
    sm2_fp_from_bytes(a, a17);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c17, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a18[32] = {0xcb,0xf5,0x3e,0x90,0xa7,0xd2,0x2f,0xe5,0xde,0xff,0x8d,0x71,0x4f,0xaf,0x34,0x01,0xaf,0xb0,0x4d,0x8f,0xa5,0x1e,0xe5,0x32,0x39,0xf1,0x8a,0xf4,0xfa,0x49,0xa3,0x0b};
    static std::uint8_t c18[32] = {0xf3,0x95,0x64,0x36,0xf4,0xdd,0x4f,0x74,0x1f,0x6d,0xac,0xfa,0x9e,0x64,0xed,0x0d,0xa8,0x06,0x6d,0x03,0x84,0xa1,0xbe,0xdc,0x3b,0x37,0x2c,0x8f,0x2e,0x57,0x56,0xb5};
    sm2_fp_from_bytes(a, a18);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c18, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a19[32] = {0x97,0x0b,0xe1,0x43,0x1a,0x5a,0x65,0x6e,0x42,0x6a,0x7d,0x88,0x44,0x70,0x4b,0xe0,0x8d,0x04,0x85,0x7f,0xae,0x73,0xbe,0xec,0xb4,0x8a,0x7c,0x5c,0xed,0x3f,0xab,0xf7};
    static std::uint8_t c19[32] = {0x07,0x2d,0xdf,0xf8,0x96,0xb4,0x57,0xa9,0x04,0xf2,0x7d,0x9f,0x29,0x76,0xf8,0xd4,0xfb,0xa4,0xbf,0x9a,0x22,0x4f,0x6a,0xb3,0x75,0x2c,0x8a,0xab,0xcc,0xd3,0x06,0xc3};
    sm2_fp_from_bytes(a, a19);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c19, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a20[32] = {0x3a,0xc8,0x3f,0x41,0x9d,0x9e,0xe3,0xe3,0x9f,0xf0,0x95,0xa0,0x47,0x67,0xb4,0x7f,0x76,0xaa,0x32,0x2c,0x66,0x0d,0x9b,0x6e,0x8b,0x53,0x50,0x9b,0x8b,0x1d,0xfe,0xb0};
    static std::uint8_t c20[32] = {0x97,0x29,0xff,0x02,0xcc,0x9c,0xc4,0xa8,0x36,0x92,0x22,0xbd,0x5e,0x8b,0x70,0x08,0xc0,0xce,0xce,0x57,0xf5,0xa5,0xa6,0x73,0x94,0x43,0xb9,0x18,0x56,0x54,0xc1,0x9e};
    sm2_fp_from_bytes(a, a20);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c20, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a21[32] = {0x5a,0x90,0x80,0x39,0x8e,0xbb,0x88,0x8e,0x7d,0x87,0xed,0xe1,0xf9,0x8d,0xe5,0xef,0x75,0x7b,0xfd,0x6f,0xf7,0xa5,0x85,0xe0,0x9c,0x40,0x3c,0x30,0x4f,0x20,0x17,0x79};
    static std::uint8_t c21[32] = {0xe9,0xba,0x7b,0x34,0xc9,0x4a,0x80,0x00,0x67,0xfa,0x79,0xb6,0x37,0xfd,0x7f,0xd8,0x09,0x48,0x20,0xf4,0x4a,0x98,0xe3,0x37,0x39,0x43,0x95,0x74,0x7e,0x00,0xd2,0x49};
    sm2_fp_from_bytes(a, a21);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c21, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a22[32] = {0x0a,0xe0,0x24,0xd3,0x24,0x8f,0x5e,0x8f,0x54,0xdc,0xda,0xe8,0x98,0xbf,0x21,0x86,0x28,0xd3,0xaf,0xde,0x60,0x09,0x81,0xd7,0x77,0x39,0x75,0xae,0x62,0xc9,0x50,0xe5};
    static std::uint8_t c22[32] = {0x18,0xac,0xfb,0x26,0xde,0x39,0x63,0x9b,0xaa,0xba,0x5d,0x3f,0xdd,0x3e,0x16,0xbd,0xe4,0x74,0x99,0x61,0xf1,0xf8,0x37,0x14,0x0b,0x7b,0xd1,0x67,0xb2,0xfd,0x8a,0x7d};
    sm2_fp_from_bytes(a, a22);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c22, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a23[32] = {0xa5,0x7c,0xb0,0x97,0xd7,0x35,0xff,0xc6,0x75,0x9f,0x3c,0x39,0xb3,0xe2,0x14,0x68,0x24,0xfb,0x2a,0xfe,0xc4,0x51,0x97,0xbc,0x13,0x55,0x55,0x1d,0xa5,0x5d,0x82,0x5b};
    static std::uint8_t c23[32] = {0x6d,0xb2,0x9e,0xde,0x8c,0x09,0x9b,0x5f,0xfa,0x27,0x8f,0x72,0x1e,0x48,0xf1,0x62,0xe8,0xa8,0x78,0xfb,0xbf,0xe5,0xaf,0xb8,0x3d,0xa8,0xe1,0x2d,0xd8,0xeb,0xff,0x75};
    sm2_fp_from_bytes(a, a23);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c23, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a24[32] = {0xfc,0x08,0xb9,0xc2,0xb4,0x8c,0xaf,0xcc,0xa3,0x0a,0xff,0x24,0x49,0x97,0x2d,0x5d,0x08,0x46,0x43,0x7f,0x01,0x50,0xa4,0x0b,0x52,0x90,0xee,0xd5,0x92,0x6e,0x80,0xf4};
    static std::uint8_t c24[32] = {0x6d,0xa7,0x85,0x8b,0x3f,0xc5,0x75,0x28,0x33,0xde,0xcc,0xe0,0x2e,0x52,0x3f,0xcd,0xcc,0x62,0x0d,0x82,0xe3,0xb3,0x63,0xe9,0x05,0x37,0x7d,0xda,0x84,0x7c,0xf8,0x00};
    sm2_fp_from_bytes(a, a24);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c24, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a25[32] = {0x03,0x48,0x89,0xc1,0x00,0xdf,0x68,0x97,0x3a,0x9a,0x44,0x57,0x56,0x38,0xb5,0x68,0xa7,0xe8,0xd7,0x4b,0x95,0xef,0x35,0xc9,0x61,0xd4,0x6b,0xd5,0x01,0x7b,0x00,0xf7};
    static std::uint8_t c25[32] = {0x7a,0x77,0x9a,0x80,0x83,0x0f,0xd8,0x4f,0xe4,0x1b,0xdd,0xb5,0x97,0x0a,0x0e,0xad,0x4b,0x4b,0x5d,0x57,0xfa,0x18,0x78,0x85,0x87,0xa2,0x7a,0x81,0xde,0x9a,0x2b,0xd2};
    sm2_fp_from_bytes(a, a25);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c25, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a26[32] = {0x7a,0xc1,0x65,0xfc,0xc3,0x29,0x12,0x4d,0x6d,0xe6,0x06,0x60,0x6f,0xf3,0x47,0x18,0xcb,0x83,0x0c,0x13,0xda,0x5d,0x12,0x0e,0x26,0xbd,0x2d,0x20,0xea,0x4e,0x0b,0x95};
    static std::uint8_t c26[32] = {0xfa,0x5a,0xc0,0x03,0x83,0x05,0x2a,0x93,0x16,0x6e,0xfd,0xca,0xba,0x72,0x89,0xb8,0xf7,0x7f,0x53,0x42,0xa2,0x73,0x40,0xbb,0x4f,0x4b,0x52,0x64,0xdd,0x01,0x6b,0x6d};
    sm2_fp_from_bytes(a, a26);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c26, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a27[32] = {0x30,0x5d,0x5e,0xc2,0x58,0x8a,0x98,0x78,0x81,0x22,0x2c,0x5c,0xd0,0x27,0xd5,0x98,0x04,0x70,0x96,0x71,0x3a,0x5d,0xf1,0x8e,0x30,0x87,0x30,0xa6,0xaa,0x9d,0xc1,0x3c};
    static std::uint8_t c27[32] = {0xa5,0x4c,0xa6,0x36,0x4c,0x2a,0x6c,0x96,0x26,0x3f,0x28,0x89,0xb7,0xdf,0xc4,0x49,0x91,0x96,0x9f,0x0a,0xce,0xe9,0x9b,0x40,0xcc,0xd7,0xb0,0xa0,0xdf,0x71,0xb3,0x34};
    sm2_fp_from_bytes(a, a27);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c27, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a28[32] = {0x9b,0x6a,0x5d,0x8e,0x4a,0x8d,0xee,0x7e,0x19,0x72,0x63,0xd1,0x09,0xf1,0x22,0xd4,0xdf,0xad,0x06,0xe5,0x5e,0xa7,0x8a,0x24,0xb5,0x97,0xde,0xa1,0x61,0x46,0x27,0xc7};
    static std::uint8_t c28[32] = {0xf9,0x12,0xd2,0x76,0x67,0xa7,0x86,0x97,0x8e,0x4e,0xaf,0xb2,0x21,0x62,0xc6,0xdf,0xd5,0xc0,0xe1,0x90,0x55,0xa1,0x81,0x11,0x04,0xf0,0x1a,0x89,0x73,0x73,0x20,0x79};
    sm2_fp_from_bytes(a, a28);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c28, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a29[32] = {0x32,0x82,0x96,0x84,0xf1,0x75,0xb2,0x81,0x9f,0x7f,0xd3,0xcf,0x0a,0x58,0x6b,0x15,0xb5,0xc8,0x51,0x3d,0xd8,0xc3,0xf3,0xc5,0x73,0xb2,0x75,0xba,0xe9,0xb5,0x8e,0x75};
    static std::uint8_t c29[32] = {0x23,0x32,0x70,0xe5,0xb3,0x1f,0x56,0x39,0xc3,0x3f,0x24,0xa4,0x1f,0x5b,0x13,0x0b,0x54,0x8f,0xb4,0xcd,0x0d,0x6f,0x64,0x96,0xa9,0xfc,0x7d,0xd0,0x35,0x35,0x9e,0x55};
    sm2_fp_from_bytes(a, a29);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c29, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a30[32] = {0x71,0xfa,0x6e,0x02,0x06,0xd5,0xe0,0x60,0x57,0x5b,0x8a,0xf8,0x1a,0x9a,0x67,0x19,0xed,0xbc,0xa6,0x82,0x4a,0xec,0x33,0xe0,0x20,0x7e,0xc6,0x1f,0xab,0xe3,0xbd,0xe3};
    static std::uint8_t c30[32] = {0xd8,0x86,0xd5,0x50,0x17,0x43,0x98,0x9a,0xdc,0x7e,0x68,0x86,0xd3,0x4f,0xf1,0x2e,0xf0,0x16,0x64,0xcf,0x54,0x74,0x0e,0x9a,0x2c,0xce,0x97,0x17,0x0d,0xf6,0x31,0x5d};
    sm2_fp_from_bytes(a, a30);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c30, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a31[32] = {0x1e,0x52,0xff,0x2c,0x8d,0xc3,0x41,0x53,0xe4,0x63,0x13,0x97,0x3e,0xe0,0x3a,0x55,0x0d,0xc4,0x43,0x8b,0x8c,0x72,0x2e,0xec,0x25,0xc0,0xd1,0x9c,0x65,0xb4,0x76,0x56};
    static std::uint8_t c31[32] = {0x10,0x2d,0x55,0xda,0xd5,0x90,0xcc,0x68,0xd8,0xea,0x1d,0xc4,0xb3,0x62,0x7f,0xbe,0xe5,0x49,0x69,0xb1,0xf0,0x17,0x6b,0x63,0xa5,0xa6,0x79,0xba,0xc3,0x54,0xac,0xb4};
    sm2_fp_from_bytes(a, a31);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c31, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a32[32] = {0xdc,0x84,0xaf,0x9b,0x34,0x0b,0xaa,0xba,0x6d,0x88,0xd8,0xc6,0x4b,0x40,0x28,0x01,0xaa,0x96,0xb9,0x72,0x21,0x9c,0x15,0xa0,0x08,0x07,0x29,0xcb,0x48,0x78,0xdd,0xb3};
    static std::uint8_t c32[32] = {0x5e,0xc7,0xc0,0x67,0xfa,0xa6,0xc1,0x54,0xb5,0x8b,0x09,0xa0,0x7e,0xd5,0x56,0xf7,0x11,0xf2,0x2a,0xd1,0xfb,0xce,0x45,0xbb,0xfc,0x11,0x5e,0x79,0x33,0x16,0x15,0xae};
    sm2_fp_from_bytes(a, a32);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c32, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a33[32] = {0x8c,0x75,0xbc,0xac,0x0b,0xa5,0x13,0xe9,0x2e,0x10,0x0a,0x7f,0xf6,0xe7,0x1e,0x29,0x44,0x91,0xf9,0x66,0xac,0x6d,0xfb,0xe6,0x68,0x3a,0x78,0xa0,0xc0,0x57,0xce,0x29};
    static std::uint8_t c33[32] = {0x59,0xf3,0x07,0x9b,0xea,0x23,0xd5,0xfd,0xe9,0xf0,0xc5,0x37,0x92,0x5a,0x1b,0x11,0xe1,0xa5,0x97,0x3e,0x8b,0x50,0xa4,0xc2,0xf2,0x94,0x8c,0x91,0x89,0x03,0xcb,0xce};
    sm2_fp_from_bytes(a, a33);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c33, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a34[32] = {0x94,0xe3,0xa8,0xa6,0x21,0x76,0x65,0x47,0xab,0xc6,0xfa,0x2c,0xa8,0x9f,0x2f,0x3f,0x6c,0x07,0xe7,0xee,0xe1,0x5b,0x5b,0x70,0xa5,0x10,0x11,0xa3,0xb5,0xd4,0xe3,0x92};
    static std::uint8_t c34[32] = {0x77,0xd1,0xc1,0xed,0xe9,0x5b,0xb0,0xc5,0x3e,0x5f,0xeb,0x8a,0x79,0x00,0x53,0x33,0x7d,0x9a,0xd6,0xd7,0x5e,0x3f,0x3d,0xa4,0xee,0xc3,0x5d,0x30,0x00,0x17,0xb0,0x30};
    sm2_fp_from_bytes(a, a34);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c34, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a35[32] = {0x8d,0xfb,0xf1,0xa3,0xe5,0xfc,0xe4,0x6a,0x13,0xba,0x1f,0xed,0xc5,0x2b,0xd9,0x54,0x8e,0xe1,0x73,0x64,0x69,0x62,0x1b,0x58,0x5d,0x1b,0x35,0xe8,0x40,0x40,0xd1,0x79};
    static std::uint8_t c35[32] = {0x9c,0xea,0x4c,0x41,0x19,0xd5,0xb8,0xb4,0x96,0x5d,0x90,0xac,0xbc,0x5a,0xd1,0x7d,0xa7,0x3d,0x05,0x08,0xa0,0x09,0xc5,0x77,0x77,0xbf,0xa5,0x67,0x66,0xd7,0x64,0x27};
    sm2_fp_from_bytes(a, a35);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c35, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a36[32] = {0xe5,0x97,0x54,0x95,0x42,0xf4,0xd5,0x50,0x00,0x1b,0x68,0x62,0x95,0x6a,0xb4,0x26,0xb9,0xc1,0xee,0x77,0xef,0xbf,0xfa,0xb6,0x0a,0x5e,0x75,0xec,0xd9,0xdf,0x68,0x26};
    static std::uint8_t c36[32] = {0x57,0xc2,0x0c,0x44,0x0f,0x51,0xed,0x3f,0x54,0xc1,0x06,0xb9,0x33,0xda,0x93,0x0b,0x4d,0x11,0x9f,0x90,0x62,0x6e,0x61,0xde,0x8a,0xa6,0x16,0x47,0xcc,0x8f,0x03,0x9d};
    sm2_fp_from_bytes(a, a36);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c36, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a37[32] = {0x14,0xb0,0x43,0x2a,0xfe,0x73,0x75,0x98,0x1f,0x0a,0x66,0x6d,0x60,0x8f,0xdd,0x3d,0x41,0x8a,0x69,0xac,0x49,0x3f,0xaa,0x9e,0x2b,0x9c,0x7c,0x38,0xf5,0xf5,0xa7,0x28};
    static std::uint8_t c37[32] = {0x7b,0xe0,0x17,0x40,0x88,0xe0,0xbd,0xf2,0x46,0x2a,0x7a,0x58,0x78,0x99,0x9b,0xcf,0x7a,0x69,0xc5,0xcb,0x03,0x81,0x01,0x0c,0x22,0xb1,0x71,0x63,0xfd,0xb0,0xcf,0x8e};
    sm2_fp_from_bytes(a, a37);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c37, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a38[32] = {0x33,0x3c,0xf8,0xe8,0x65,0xef,0x77,0x08,0xde,0xfb,0x91,0x6c,0x09,0xf2,0x5a,0x10,0x81,0xea,0xed,0xa6,0x3d,0x8c,0x35,0x89,0x4a,0x16,0x1a,0x88,0x6b,0xe3,0x41,0x24};
    static std::uint8_t c38[32] = {0xca,0xcf,0x42,0xfc,0x3b,0x9e,0x0c,0x94,0xb3,0x6b,0xc9,0x8a,0x8d,0x96,0x78,0xa3,0x56,0x4b,0x1b,0x7c,0x53,0x7b,0x9f,0xa2,0x97,0xf3,0xe6,0xbc,0x8c,0x38,0x2e,0xc2};
    sm2_fp_from_bytes(a, a38);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c38, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a39[32] = {0xe6,0xc7,0x64,0xda,0x94,0x72,0x34,0x11,0xca,0x76,0x75,0x8c,0xe4,0xa0,0x06,0x15,0x02,0x64,0x14,0x35,0xb7,0xc2,0x9c,0xd3,0xfe,0xf0,0x1b,0x56,0x2d,0xa9,0x07,0xba};
    static std::uint8_t c39[32] = {0x30,0x01,0x25,0x07,0x1d,0x32,0x88,0x05,0x8c,0xa4,0x05,0xa7,0xdc,0xe3,0x0a,0x33,0xec,0x6a,0xcc,0xc2,0x87,0x1c,0x78,0xa9,0x5a,0x54,0xbb,0x99,0x36,0x57,0xcd,0x52};
    sm2_fp_from_bytes(a, a39);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c39, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a40[32] = {0x02,0x46,0x77,0x44,0x81,0x06,0xdb,0x54,0x3d,0xf5,0x10,0xc5,0xec,0xbd,0x35,0x56,0x0d,0x05,0x06,0x4e,0x6b,0x0a,0x16,0xc5,0xa4,0xff,0xff,0x90,0xa2,0x29,0xb2,0x32};
    static std::uint8_t c40[32] = {0x18,0x0d,0xc0,0x7b,0xd7,0xd0,0x2c,0x00,0x5e,0x19,0x2d,0x5f,0x59,0x6b,0x0e,0xa3,0xcf,0x16,0x21,0xdf,0xbe,0x5e,0xf0,0x26,0x04,0xbb,0x4e,0x36,0x56,0x55,0x49,0x9f};
    sm2_fp_from_bytes(a, a40);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c40, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a41[32] = {0x73,0x2f,0xeb,0x4a,0xf8,0xc1,0x3a,0x8f,0x6a,0x76,0xf8,0xe7,0x3e,0x00,0xd3,0x6c,0x75,0xa7,0xc1,0x04,0xe6,0x0a,0xac,0xa7,0x0f,0x66,0x2d,0xb2,0xb4,0x9b,0x0e,0x05};
    static std::uint8_t c41[32] = {0x75,0xc7,0x28,0x36,0xd1,0xb0,0x16,0xc7,0x14,0xcc,0x3c,0xed,0x01,0x36,0xb5,0x2f,0x49,0x8d,0xa5,0xde,0x68,0xca,0xeb,0x02,0x9f,0x13,0x7c,0x01,0xd1,0x46,0x53,0xeb};
    sm2_fp_from_bytes(a, a41);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c41, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a42[32] = {0xf4,0x8e,0xee,0xb5,0x05,0x7c,0xda,0xac,0xce,0x7b,0x77,0x89,0x30,0x1d,0xde,0xf9,0x15,0x57,0x70,0x1a,0xc9,0xad,0x9d,0xb0,0x53,0xca,0xec,0xb0,0xd0,0x77,0x49,0xfd};
    static std::uint8_t c42[32] = {0x6c,0x58,0x15,0x80,0x3f,0x2e,0xbb,0xd4,0x9b,0xdc,0x04,0x28,0x00,0xb6,0x67,0xe6,0x87,0xad,0x0e,0xae,0x6f,0xb4,0xce,0xb3,0xb0,0x62,0xe3,0x0a,0xf7,0x68,0x10,0x72};
    sm2_fp_from_bytes(a, a42);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c42, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a43[32] = {0xe3,0x1d,0x1b,0x9b,0x8d,0xa2,0xcd,0x84,0xa5,0x79,0x57,0x4c,0x13,0xc2,0x4b,0xe4,0xfc,0x09,0x6d,0x00,0xa9,0x3a,0xc6,0xd8,0x20,0x1e,0x56,0xd8,0xbd,0xb1,0x9f,0xc1};
    static std::uint8_t c43[32] = {0xc0,0x18,0x5d,0x13,0x59,0xe8,0x66,0x76,0x33,0xa3,0xd5,0x15,0x13,0xd0,0xc4,0xc1,0x2e,0x55,0x02,0x13,0xc7,0xd2,0x4a,0x12,0x99,0x81,0x1a,0x4d,0xef,0x90,0x15,0x6f};
    sm2_fp_from_bytes(a, a43);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c43, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a44[32] = {0x16,0x40,0x95,0xac,0x82,0xc7,0x04,0xbd,0xd3,0x63,0x49,0x38,0xc4,0xc9,0x0b,0xb2,0x9c,0xa1,0xcf,0xec,0xe3,0x36,0xcc,0x44,0x4a,0x3b,0x0e,0xc5,0xe9,0xf2,0x61,0x90};
    static std::uint8_t c44[32] = {0x01,0xac,0x45,0x09,0xed,0xf2,0x75,0x97,0x36,0x2e,0x72,0x99,0x69,0x0e,0xf8,0x5e,0x25,0xb0,0x25,0x41,0xd9,0x7c,0x3d,0x75,0xc0,0xc5,0xb1,0x14,0x89,0xe6,0xa9,0x61};
    sm2_fp_from_bytes(a, a44);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c44, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a45[32] = {0x20,0x1d,0x61,0xbb,0x49,0xfb,0xac,0xf3,0x73,0xd2,0x54,0xe1,0x13,0xdf,0x55,0x01,0xc5,0xe5,0xac,0xf3,0x0f,0xef,0xae,0x47,0x8c,0x17,0x22,0xc4,0x58,0x08,0x86,0xaf};
    static std::uint8_t c45[32] = {0x38,0xf1,0x18,0xb3,0x7f,0x99,0x0a,0xe0,0x42,0xb4,0x60,0xa5,0x4f,0x44,0x46,0xc3,0x88,0x9e,0x30,0xc7,0x39,0x1d,0x77,0x7a,0x31,0xe6,0x2b,0x25,0x92,0x6f,0x5b,0x7e};
    sm2_fp_from_bytes(a, a45);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c45, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a46[32] = {0x19,0x15,0x16,0xf2,0x8b,0x64,0x80,0x41,0x0a,0x61,0x5c,0xd9,0x11,0xad,0xae,0xd6,0x7f,0x5e,0xb5,0x68,0xf4,0xda,0x36,0x23,0x49,0x15,0x55,0x80,0xc8,0x8d,0xf4,0x91};
    static std::uint8_t c46[32] = {0x46,0x96,0xfc,0xdc,0x08,0xb7,0x30,0x34,0xbd,0xc9,0x55,0x5c,0x48,0x47,0x41,0xed,0x23,0x60,0x3a,0xdc,0xc5,0x13,0xf0,0x6a,0x93,0x51,0xf5,0xc7,0x2d,0x20,0x71,0xa7};
    sm2_fp_from_bytes(a, a46);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c46, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a47[32] = {0x68,0xf5,0x20,0xe2,0xf6,0xcc,0xb4,0x14,0x02,0x09,0x9a,0xfe,0x77,0x6c,0x98,0x95,0x4d,0xd9,0x95,0x96,0xfc,0xf0,0x2d,0x20,0xfa,0x28,0xf7,0xbb,0x9a,0x33,0x1e,0x5a};
    static std::uint8_t c47[32] = {0xa3,0x50,0x6e,0x0f,0x55,0xd5,0x9a,0x73,0xba,0x74,0x95,0xb7,0x46,0x48,0x78,0x96,0x78,0x1e,0xfb,0xc4,0x9a,0x54,0x80,0xb7,0x1c,0xdc,0xf0,0x48,0xe6,0xf6,0xcb,0xfc};
    sm2_fp_from_bytes(a, a47);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c47, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a48[32] = {0x3b,0xd1,0xdb,0x3c,0x22,0x3a,0xca,0x8a,0xb0,0x60,0x6f,0xb2,0xcc,0x0c,0xd3,0x62,0x5f,0x13,0x5d,0x8d,0x5f,0x52,0x16,0x03,0xc9,0x12,0x4a,0xd2,0x0d,0x6c,0x2f,0xa3};
    static std::uint8_t c48[32] = {0x71,0x1e,0x72,0x58,0x52,0xa7,0xe6,0x96,0x78,0xcb,0x21,0x72,0x9b,0x1e,0x53,0x8c,0x30,0x2e,0x43,0xe3,0x57,0xbb,0x8c,0xc5,0xe7,0x94,0x4c,0xee,0x6a,0x4d,0x65,0xe4};
    sm2_fp_from_bytes(a, a48);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c48, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a49[32] = {0xa9,0xff,0xf3,0x83,0xb3,0xe1,0x11,0x12,0xc7,0x93,0xb2,0x77,0xe7,0xab,0x6d,0x58,0x85,0x52,0xc6,0x32,0xe8,0xe0,0x2e,0xa3,0x36,0x40,0x4b,0x2a,0xda,0xf0,0x21,0x34};
    static std::uint8_t c49[32] = {0x6c,0x27,0xfc,0x05,0x2f,0xec,0xd1,0xd1,0xa2,0x65,0xa7,0xec,0x31,0x71,0x46,0x87,0xa5,0x7a,0x28,0xc4,0xab,0x09,0x62,0x89,0x3d,0x45,0x5a,0x43,0x6d,0xbc,0xdd,0x42};
    sm2_fp_from_bytes(a, a49);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c49, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a50[32] = {0xaa,0x3b,0xbd,0xf8,0xbd,0xb8,0xcd,0xf1,0x9f,0x7a,0xfa,0xf1,0x71,0x56,0x0f,0x78,0xcb,0x7e,0xca,0x44,0xdb,0x92,0xad,0xa2,0x24,0x26,0xf1,0x5c,0x26,0x9a,0x80,0x43};
    static std::uint8_t c50[32] = {0x41,0x04,0xac,0x4e,0xd9,0x3d,0x15,0xbe,0x12,0xb4,0xc2,0x12,0x0b,0xf3,0xf1,0xd0,0xf2,0xf1,0x0d,0x49,0x97,0xd4,0x8b,0x95,0x44,0xb1,0xb5,0xe8,0xa5,0x70,0xd6,0x4c};
    sm2_fp_from_bytes(a, a50);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c50, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a51[32] = {0xe5,0x64,0xe2,0xc3,0xe7,0x2b,0x0f,0x8b,0x2f,0xb8,0xb6,0x18,0x80,0xd3,0xa9,0xbb,0xea,0xf7,0x4b,0x7a,0x16,0x59,0xd4,0xa9,0x9d,0xf8,0x3c,0x72,0xba,0x02,0xe4,0xc2};
    static std::uint8_t c51[32] = {0xbc,0x5f,0xd1,0xa5,0x29,0x0a,0xcd,0xe7,0xab,0x65,0xb0,0x25,0x62,0x88,0xde,0x52,0x70,0xd8,0x18,0x7d,0xb5,0xe8,0x46,0xce,0xe8,0xdd,0xbe,0x32,0x91,0xe7,0x10,0xc5};
    sm2_fp_from_bytes(a, a51);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c51, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a52[32] = {0xa6,0x53,0xa4,0xee,0x11,0x95,0x2d,0x30,0xb8,0xa6,0xf2,0xdb,0x1c,0x2b,0xdf,0xa7,0x4a,0x42,0x38,0xbf,0x68,0x0d,0xcd,0xa6,0x05,0x83,0xf1,0xa7,0xa2,0x50,0xb6,0x4b};
    static std::uint8_t c52[32] = {0x06,0x58,0x02,0xeb,0x34,0x18,0x8a,0x9f,0x89,0x5d,0x75,0x13,0xfb,0x7b,0xef,0x13,0x44,0xc5,0xdb,0xde,0x3b,0x57,0x57,0x71,0x44,0xbd,0xf3,0x24,0x84,0xa0,0xc1,0xcc};
    sm2_fp_from_bytes(a, a52);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c52, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a53[32] = {0x95,0xf7,0xc4,0x68,0xed,0xf5,0xfe,0x37,0xf0,0xd5,0x0e,0x60,0x62,0x7a,0x48,0xcd,0x88,0x12,0x0d,0x24,0x3d,0xd2,0xa2,0xa2,0xcd,0xe2,0x3b,0x38,0xda,0x09,0x6b,0x53};
    static std::uint8_t c53[32] = {0xfe,0xca,0x6a,0xbe,0x83,0xe1,0x58,0x4a,0xb1,0x68,0x07,0x8b,0xbc,0xcc,0x87,0x56,0xd5,0x15,0x97,0xc8,0x2f,0xf8,0x15,0x82,0x98,0x47,0xe8,0xe9,0x79,0xf3,0xae,0x1c};
    sm2_fp_from_bytes(a, a53);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c53, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a54[32] = {0x7a,0xf3,0x1a,0xd1,0xbe,0x99,0xcf,0x7c,0xea,0x22,0xd2,0xc5,0x26,0x4b,0x2e,0xe2,0xbd,0x34,0x29,0x75,0x00,0xd6,0xc2,0x4f,0x9d,0xe0,0x21,0x3f,0x5b,0xe4,0xaa,0xb6};
    static std::uint8_t c54[32] = {0x1e,0xcb,0x89,0xe6,0xb3,0x7c,0x0c,0x30,0xaf,0xa5,0xf9,0x63,0x61,0x87,0x3d,0xb4,0x4d,0x08,0xab,0x81,0x02,0x14,0x5b,0xd8,0x68,0x98,0xa4,0x83,0xe2,0xfb,0x3d,0xaf};
    sm2_fp_from_bytes(a, a54);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c54, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a55[32] = {0x74,0xb5,0xdf,0x6b,0xe5,0x07,0xdd,0xaf,0xc6,0xfe,0x80,0xb3,0x6e,0xdc,0x9c,0x30,0x9a,0x55,0xa0,0x15,0xfb,0x3e,0xb2,0xf7,0x40,0x72,0xc8,0xe9,0x69,0xca,0x1d,0xc3};
    static std::uint8_t c55[32] = {0x04,0xe4,0x61,0xd4,0x5a,0x09,0xac,0x37,0xdf,0x5b,0x37,0x51,0xe7,0xd2,0xad,0x78,0x72,0xe2,0x87,0x82,0xb1,0x4e,0xf6,0x3f,0x53,0xca,0xfb,0x5d,0x8a,0xc8,0x74,0x7d};
    sm2_fp_from_bytes(a, a55);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c55, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a56[32] = {0x73,0x69,0xea,0x67,0x04,0x0c,0x9d,0xb2,0xde,0x88,0x9a,0x2b,0xac,0x79,0x1e,0x1b,0x00,0x17,0x67,0xc4,0x0c,0xee,0xae,0x99,0xf3,0x08,0x43,0x3b,0x59,0x07,0x35,0x73};
    static std::uint8_t c56[32] = {0x99,0xa0,0x0f,0xe5,0x39,0xad,0x2c,0xd7,0x25,0xb2,0x57,0xf5,0x0c,0xe8,0x0d,0x9c,0xdf,0xa2,0x0a,0xc7,0x10,0x21,0x5a,0xbf,0xc0,0x0e,0x5f,0xea,0xc2,0x2f,0x01,0xd9};
    sm2_fp_from_bytes(a, a56);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c56, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a57[32] = {0xfa,0x65,0x13,0x6e,0x36,0x41,0x42,0x3c,0x4c,0xc6,0xba,0x57,0x77,0xf0,0xd0,0x63,0xdd,0x54,0xbc,0x9c,0x48,0xa5,0x88,0x43,0x60,0xfe,0xf1,0xb6,0x71,0x91,0xa3,0x90};
    static std::uint8_t c57[32] = {0xcb,0xac,0x1e,0x22,0x26,0x62,0x9d,0x82,0xc7,0x00,0xaf,0xff,0xcf,0x1d,0x1b,0x04,0x22,0x93,0x9f,0xc5,0x2c,0x21,0x42,0xac,0x54,0x1f,0xb0,0xa4,0xba,0x77,0x70,0xdb};
    sm2_fp_from_bytes(a, a57);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c57, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a58[32] = {0xc0,0xe2,0xf4,0x54,0x53,0x21,0x07,0xee,0x6e,0x83,0x4d,0xed,0x0d,0x20,0xb3,0xb7,0x03,0xb4,0xb8,0xd8,0xc1,0x9b,0x9d,0xa3,0x4c,0x73,0xc1,0x80,0x57,0x28,0x15,0xdb};
    static std::uint8_t c58[32] = {0x45,0x6e,0x13,0x03,0x2a,0x16,0xf0,0xdc,0x8b,0x7b,0x16,0x14,0x9b,0x7a,0x74,0xd2,0xe1,0x8e,0xc7,0x92,0x2d,0xea,0x2f,0x83,0xcd,0xf1,0x36,0x03,0x73,0x72,0x7a,0x10};
    sm2_fp_from_bytes(a, a58);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c58, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a59[32] = {0x6a,0x87,0x9a,0x51,0x72,0xa9,0x1a,0x82,0xbe,0xb8,0xc3,0x98,0x66,0xb4,0x3e,0x9a,0xfe,0xa3,0x23,0xeb,0x3d,0xaf,0x32,0x19,0x77,0x1d,0x32,0xb9,0x2e,0x45,0x62,0xd2};
    static std::uint8_t c59[32] = {0x1d,0xb1,0xdb,0x94,0x71,0x84,0x8c,0x94,0x61,0x42,0x8e,0xb3,0xe7,0x2a,0x49,0x0c,0x4e,0xdb,0xbc,0x17,0x06,0x72,0x61,0x7d,0x6c,0xde,0x7a,0x04,0xe2,0xcb,0x1d,0x37};
    sm2_fp_from_bytes(a, a59);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c59, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a60[32] = {0x50,0xc1,0xc8,0xe0,0xf6,0x94,0x73,0xc6,0x20,0x1e,0x55,0x3e,0x04,0x20,0x2e,0x12,0x20,0x67,0x52,0x12,0xfc,0x7c,0xa5,0xf1,0xaf,0x53,0xc2,0xbe,0xd0,0x00,0xc6,0xb7};
    static std::uint8_t c60[32] = {0xec,0x67,0xd6,0x5f,0x3f,0x31,0xa5,0x98,0x23,0x19,0xc5,0x24,0x66,0xe6,0x33,0xfe,0xb5,0xb4,0x2f,0xf7,0x6b,0x95,0x78,0x2d,0x3f,0x09,0x4c,0x3e,0x4b,0x23,0xa6,0xb1};
    sm2_fp_from_bytes(a, a60);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c60, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a61[32] = {0x4d,0xdd,0x85,0x02,0xea,0xa9,0x33,0x22,0xf9,0xc8,0x64,0xca,0x08,0x10,0xec,0x5c,0x85,0x02,0xad,0xe1,0xe9,0x87,0x0c,0xaf,0x4f,0x2c,0x52,0x87,0x2e,0xad,0x42,0x15};
    static std::uint8_t c61[32] = {0xea,0x13,0xe9,0x71,0xa7,0x53,0x35,0x2f,0xf6,0xbf,0x4a,0x39,0xb6,0xcc,0xb6,0xec,0x73,0xdf,0xe2,0xfe,0x7e,0x0c,0x9c,0x0a,0x97,0x11,0x2f,0x3c,0xbf,0xbe,0x37,0x5d};
    sm2_fp_from_bytes(a, a61);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c61, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a62[32] = {0xac,0xaf,0x12,0x0b,0xd9,0x39,0xc1,0x77,0x3d,0x1d,0x96,0x37,0x7c,0x8a,0x82,0x3d,0xf8,0x7e,0xd5,0x83,0x6f,0x19,0xff,0xb6,0xec,0xa8,0x91,0x25,0xb0,0x78,0x3f,0xa8};
    static std::uint8_t c62[32] = {0xe5,0x2f,0xe4,0x9f,0x68,0x32,0xe5,0x7d,0x7a,0x96,0x2f,0xa7,0xcb,0x68,0x76,0x18,0x87,0xd0,0x31,0xc4,0x71,0x4c,0x0f,0x2b,0xa7,0xaf,0x27,0x60,0x5e,0xd7,0x1c,0xa2};
    sm2_fp_from_bytes(a, a62);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c62, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a63[32] = {0x16,0x31,0x6e,0x39,0x47,0x54,0x2c,0xd2,0xd5,0xfe,0x76,0x4e,0xda,0xc6,0xa9,0x0b,0xe1,0xc7,0x69,0xb7,0xf8,0x85,0x90,0x27,0xbe,0xeb,0x41,0x09,0x68,0x3c,0x94,0x85};
    static std::uint8_t c63[32] = {0x95,0x70,0xae,0xd3,0x12,0xed,0xf5,0x8c,0x9b,0xb7,0x57,0x3b,0x67,0xd9,0x58,0xb2,0x3c,0x5c,0x57,0xde,0xc7,0xa5,0x79,0x52,0x5b,0x6a,0x30,0x5b,0x19,0xf5,0xe6,0x41};
    sm2_fp_from_bytes(a, a63);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c63, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a64[32] = {0x9a,0x37,0xfa,0x44,0xc5,0xa3,0x6c,0x17,0x0f,0xd6,0x5c,0x3a,0x9a,0x93,0x23,0x0f,0xe8,0x3f,0x60,0xdb,0xac,0x56,0x5b,0x07,0x8b,0x1f,0xa2,0x75,0xdc,0xe0,0x85,0xc1};
    static std::uint8_t c64[32] = {0xd9,0x51,0xdf,0x3d,0xc0,0xd9,0x66,0x5d,0xd6,0x97,0xe4,0xae,0xe3,0x91,0x10,0x16,0x8e,0x46,0x10,0x86,0x32,0xd4,0x45,0xa1,0x8f,0x6e,0x08,0xa5,0x5d,0x8d,0x84,0x9a};
    sm2_fp_from_bytes(a, a64);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c64, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a65[32] = {0x85,0x4d,0xd2,0x97,0x43,0x5d,0x55,0x2d,0xc1,0x87,0xd1,0x54,0xbd,0xed,0xab,0x78,0x28,0xc3,0xfa,0xc1,0xe3,0xc1,0x0f,0x4f,0x5a,0xc8,0x15,0xd8,0x84,0x26,0x3d,0x28};
    static std::uint8_t c65[32] = {0x51,0x4f,0xd4,0xea,0x90,0x53,0x4d,0x97,0xac,0xec,0x23,0xd1,0x11,0x19,0x95,0x00,0x74,0x83,0xf5,0x4a,0xbc,0x1f,0xab,0x72,0x52,0x5c,0xa4,0x8b,0x57,0xe4,0xa3,0x68};
    sm2_fp_from_bytes(a, a65);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c65, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a66[32] = {0xa9,0x93,0x9e,0x26,0x84,0xc2,0x0c,0x7c,0x7b,0x50,0xf3,0x0b,0xa8,0xf8,0xe3,0x85,0x9b,0x67,0x49,0x99,0x7e,0x0c,0xed,0x1f,0xe8,0xba,0xf4,0x9f,0x3a,0x3c,0xf6,0xd2};
    static std::uint8_t c66[32] = {0xcc,0x64,0x44,0x8d,0x0c,0x6a,0x4f,0xf8,0xf7,0xac,0x9f,0x5a,0xcc,0x6c,0xa4,0xff,0x17,0x64,0xdf,0xef,0x8c,0x81,0x1f,0x84,0xeb,0xcc,0x49,0xb3,0x46,0x3f,0x17,0xa1};
    sm2_fp_from_bytes(a, a66);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c66, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a67[32] = {0x4e,0x1d,0x6c,0xfa,0x2b,0x76,0xe1,0x37,0x56,0xe5,0x3a,0xa7,0x0e,0xd3,0x8c,0x2a,0x4a,0x53,0x0e,0x96,0x33,0x29,0x2d,0x4c,0xa7,0x70,0x1c,0x17,0x56,0x00,0x05,0xe2};
    static std::uint8_t c67[32] = {0xdd,0x8d,0x29,0x24,0xae,0x8b,0x32,0x09,0x9f,0xe7,0xdb,0xfb,0xb3,0x06,0xf0,0x09,0x9c,0x88,0xf1,0x58,0x35,0x4c,0x25,0x31,0xf6,0xdd,0xa8,0xe7,0xe1,0x65,0x4d,0x9e};
    sm2_fp_from_bytes(a, a67);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c67, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a68[32] = {0xfc,0x24,0x1a,0x82,0x6a,0x12,0x0b,0xfc,0x84,0xdb,0xbb,0x4b,0x2e,0x26,0x28,0x00,0x30,0x06,0x54,0xcb,0xe6,0x5e,0x65,0x7b,0xa2,0x34,0x0e,0x5c,0x1d,0x92,0x12,0x8d};
    static std::uint8_t c68[32] = {0x31,0x72,0xa8,0x4c,0x25,0xd3,0x76,0x04,0xbe,0xfe,0xbb,0xab,0x3f,0xb9,0xf9,0x1a,0x99,0x86,0xdf,0x05,0xa6,0x21,0x09,0x00,0x7c,0x4e,0xc5,0x02,0x29,0xd5,0x4a,0x3b};
    sm2_fp_from_bytes(a, a68);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c68, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a69[32] = {0x63,0xd3,0x42,0x0e,0x02,0x25,0xe3,0xe1,0x21,0x40,0xda,0xaa,0xee,0x95,0x58,0x23,0x5d,0xfd,0x07,0x18,0xe1,0xca,0x6b,0x04,0x7f,0x55,0x2f,0xb8,0x0a,0x7d,0x94,0xff};
    static std::uint8_t c69[32] = {0xa3,0x69,0xfa,0x2c,0xb4,0xed,0x88,0xe0,0xe3,0xa6,0x1e,0x6b,0x22,0xdf,0x35,0x18,0xdc,0x2f,0xfb,0xa1,0x1e,0xb9,0x8d,0x0f,0x4e,0xd7,0x43,0x9e,0x69,0x73,0xb3,0x4e};
    sm2_fp_from_bytes(a, a69);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c69, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a70[32] = {0xf9,0xb0,0x6b,0x5e,0xe8,0x39,0x61,0x4f,0x70,0x8d,0x0d,0xe2,0xc0,0x48,0x8f,0xf4,0x7f,0x5a,0x32,0x66,0x98,0xa9,0x05,0xf2,0xbc,0xe2,0xec,0x40,0xf9,0xb4,0x0f,0x94};
    static std::uint8_t c70[32] = {0x80,0x48,0x87,0x81,0x80,0xb8,0x93,0x78,0x41,0xb8,0x71,0xc8,0x8f,0xa8,0xd5,0xb0,0xbb,0x7d,0x7a,0xaf,0xc4,0xe3,0x47,0x3a,0xfe,0x50,0xa8,0xdb,0xb9,0x0f,0xe6,0xd2};
    sm2_fp_from_bytes(a, a70);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c70, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a71[32] = {0x96,0x26,0x2a,0x78,0x1b,0x42,0x28,0x38,0xe2,0xf9,0x8a,0xc3,0xdd,0x28,0x47,0x93,0x0f,0x53,0x54,0xd2,0x5e,0x7c,0xcc,0x0f,0xd2,0xdd,0xb1,0x74,0x07,0x4f,0x35,0xdb};
    static std::uint8_t c71[32] = {0x10,0xa9,0xe0,0x78,0xa0,0x31,0x79,0xa3,0xd1,0xd9,0xc4,0xc0,0xf6,0xea,0x00,0xc8,0x0f,0xd9,0x16,0x66,0x9c,0x22,0x52,0xf9,0x3e,0x5d,0x21,0x12,0xe6,0x3e,0x91,0xd7};
    sm2_fp_from_bytes(a, a71);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c71, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a72[32] = {0x8d,0x03,0x4f,0x3c,0xf1,0x3c,0xa6,0x2c,0x6f,0x16,0x8a,0xa7,0xf9,0x96,0x99,0x41,0xdf,0x49,0xc2,0xd4,0xbe,0xe1,0xef,0xa7,0x30,0xb3,0xd9,0x97,0xb5,0x28,0x16,0x04};
    static std::uint8_t c72[32] = {0x86,0x0b,0xb9,0x84,0x47,0x23,0x91,0x46,0x89,0x5b,0xd1,0x15,0xd5,0xe1,0x41,0x07,0x30,0x93,0x73,0x53,0x45,0x93,0xdf,0x8d,0xf9,0xb3,0x00,0x86,0x06,0x1b,0x2c,0x68};
    sm2_fp_from_bytes(a, a72);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c72, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a73[32] = {0xa6,0x64,0x98,0xb8,0xe9,0x2e,0x3e,0x2e,0x77,0xf1,0x77,0x22,0x60,0x08,0x4a,0xbe,0x19,0x2d,0xec,0xa0,0xb7,0x22,0x24,0xba,0x7e,0x2c,0x8a,0x54,0xdd,0x67,0x32,0x17};
    static std::uint8_t c73[32] = {0x04,0x89,0xe2,0x43,0x42,0xad,0xb2,0xb4,0x88,0x08,0x83,0x7b,0x26,0xaa,0x56,0xd8,0x27,0x80,0xd3,0x34,0xee,0x0d,0xa5,0x9d,0x05,0xe4,0x0e,0x10,0xc7,0xc4,0x58,0xc2};
    sm2_fp_from_bytes(a, a73);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c73, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a74[32] = {0x8a,0x72,0x23,0x98,0x10,0xe7,0xde,0xeb,0xed,0xc2,0x50,0x93,0x88,0xc8,0x98,0xab,0x28,0x30,0x2e,0xf8,0x3b,0x9c,0x0e,0x4e,0x64,0x5e,0x4c,0x0b,0xde,0xb5,0x33,0xf9};
    static std::uint8_t c74[32] = {0x87,0x96,0x7b,0x23,0x4f,0x27,0xbc,0xbe,0x26,0x6a,0x88,0x3a,0x62,0x13,0xd7,0x34,0x57,0x87,0x4e,0xde,0xdb,0xd0,0xd6,0x7e,0xf5,0x73,0xbe,0x92,0x98,0x34,0x92,0xbe};
    sm2_fp_from_bytes(a, a74);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c74, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a75[32] = {0xd5,0xc8,0x31,0x2d,0xd3,0xb3,0x6f,0x2a,0x27,0x99,0xe7,0xdd,0xe7,0x77,0x68,0xb9,0xa0,0xfd,0x3b,0x2d,0xb8,0xb3,0x92,0x88,0xd8,0xec,0x52,0x23,0x3b,0x3a,0x7c,0x0b};
    static std::uint8_t c75[32] = {0x54,0xfa,0x9b,0x84,0xe4,0x3b,0xd6,0xc4,0x9f,0x94,0x2d,0x8c,0x96,0x65,0x29,0xd8,0x74,0x20,0x0b,0xd8,0xd8,0x40,0xb5,0x65,0x31,0xf0,0xf3,0xe5,0x0e,0x0b,0x37,0x15};
    sm2_fp_from_bytes(a, a75);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c75, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a76[32] = {0xa8,0x40,0x02,0x86,0x5d,0xbd,0x06,0x09,0xef,0x00,0x88,0x31,0x4a,0x19,0x64,0x6f,0xe5,0x26,0xb1,0xfd,0x24,0x81,0x84,0xdc,0x49,0x07,0x51,0x32,0xe4,0x63,0x6d,0x5c};
    static std::uint8_t c76[32] = {0xdf,0x06,0xd7,0x74,0xdc,0xe6,0x9b,0x56,0xd2,0x24,0xba,0xdd,0xeb,0x6b,0xee,0xd2,0x74,0x29,0xb7,0x3d,0x3b,0x94,0x15,0x93,0x6d,0x12,0x7f,0xfa,0xc0,0xb2,0x51,0xc4};
    sm2_fp_from_bytes(a, a76);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c76, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a77[32] = {0x91,0xb3,0x5a,0x9f,0x15,0x32,0x45,0x61,0x32,0x75,0xf9,0x73,0xa9,0x53,0xcc,0xdf,0x9b,0xab,0xaf,0xb5,0x43,0x75,0xe6,0x22,0x5f,0xba,0x1d,0x8a,0x39,0x24,0x79,0x62};
    static std::uint8_t c77[32] = {0xea,0x13,0x2c,0x02,0x01,0x75,0x6d,0xac,0x50,0xcf,0x8a,0x85,0x0b,0x8a,0xf2,0x84,0xb2,0x46,0x47,0xbe,0x33,0xcf,0xd0,0x70,0xa8,0x89,0xe4,0xa6,0x4a,0xd8,0x4a,0x5c};
    sm2_fp_from_bytes(a, a77);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c77, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a78[32] = {0x90,0xb9,0x55,0x63,0x9e,0xbe,0x3c,0xda,0x90,0x69,0xe5,0xbc,0x9a,0x23,0x13,0x0b,0xbc,0x5d,0xc6,0xfb,0xd1,0x8a,0xe5,0x11,0xb7,0xa3,0xea,0x4d,0x82,0xe1,0x86,0xa8};
    static std::uint8_t c78[32] = {0xee,0x6c,0x15,0x9e,0xc1,0xb7,0x96,0x01,0x0e,0x92,0x9b,0x52,0xfa,0xa1,0x52,0x4b,0x47,0xf1,0x31,0xd5,0xef,0xe8,0xd2,0x49,0x1d,0x1d,0x84,0xad,0xfe,0xc0,0x3e,0x62};
    sm2_fp_from_bytes(a, a78);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c78, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a79[32] = {0x96,0xb4,0x5b,0x34,0x70,0xe8,0xb4,0x13,0xbe,0x9b,0x02,0x9d,0x66,0xa5,0xd8,0x2c,0x0c,0x38,0x8c,0x47,0xc3,0xb9,0x2e,0xff,0x1b,0x1f,0x1f,0x40,0x90,0xec,0xcf,0x84};
    static std::uint8_t c79[32] = {0x9c,0xa7,0xc2,0x90,0x54,0x88,0x58,0xdc,0xfe,0x37,0x64,0x3d,0xc2,0x4a,0xfe,0x5a,0x0e,0x7d,0xd0,0x6e,0x90,0x4a,0x74,0xbf,0x7a,0x2a,0x16,0x08,0x3d,0xc9,0x6c,0x71};
    sm2_fp_from_bytes(a, a79);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c79, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a80[32] = {0x1d,0xd4,0xf9,0x13,0x7d,0x31,0xbe,0xfe,0x14,0x3c,0xaf,0x2d,0xc1,0x07,0xb8,0xd9,0x41,0x7d,0x60,0x0b,0x8c,0xf1,0x5a,0xde,0xd0,0x19,0x2c,0x88,0x94,0xce,0x12,0x59};
    static std::uint8_t c80[32] = {0xac,0x2a,0x0f,0xf9,0x77,0xd0,0x58,0xeb,0x1d,0xda,0x77,0x55,0xfb,0x8d,0xcc,0xa6,0x9b,0xd9,0x5c,0x08,0xb0,0xc1,0x27,0x0d,0xc3,0xfb,0x17,0x52,0x90,0x81,0xf5,0xb9};
    sm2_fp_from_bytes(a, a80);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c80, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a81[32] = {0x50,0x2d,0x80,0xfa,0xb4,0x84,0xe9,0x38,0xa8,0x78,0x2c,0xf6,0x04,0x0e,0xbe,0x31,0xc1,0x3d,0x83,0x82,0x7b,0x48,0x98,0x4b,0x55,0xa7,0xc7,0xf7,0x67,0xcb,0xb9,0xe2};
    static std::uint8_t c81[32] = {0xb7,0xc7,0x8c,0xe5,0x1f,0x55,0x29,0x11,0x24,0x53,0xf0,0x2c,0xf6,0x97,0x7d,0x62,0xe9,0x56,0xaa,0x88,0x6a,0x82,0x6e,0x64,0x39,0x7f,0x4b,0x73,0x14,0x22,0xff,0xf5};
    sm2_fp_from_bytes(a, a81);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c81, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a82[32] = {0x96,0xfc,0xf2,0x32,0xd5,0xdd,0x90,0x9f,0xf7,0x01,0xd6,0xd7,0xf0,0x20,0xb6,0x39,0xf1,0x6f,0x04,0xee,0xd6,0x9b,0x0a,0x2d,0x69,0x92,0x45,0xfc,0x8c,0x80,0x0e,0xd5};
    static std::uint8_t c82[32] = {0xf7,0x6b,0xcb,0x0c,0x23,0x55,0xee,0x97,0x7d,0xa0,0x65,0x37,0xa0,0x2d,0x55,0xa3,0x2f,0xd7,0x04,0x4b,0x5d,0x95,0x6d,0x1a,0xf0,0xab,0xbe,0x16,0xec,0x6d,0x89,0x2f};
    sm2_fp_from_bytes(a, a82);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c82, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a83[32] = {0xc3,0x89,0xd2,0xc7,0xc1,0x00,0x52,0xe9,0x83,0x6e,0xbc,0x66,0x12,0x65,0xf0,0x5c,0xb3,0x9e,0xc2,0x13,0x77,0xf6,0x8b,0xb3,0x59,0xbe,0x9a,0x8a,0xfd,0x5d,0xe1,0xd6};
    static std::uint8_t c83[32] = {0xaf,0x22,0x56,0xcc,0xb9,0x4d,0x12,0x26,0x30,0x97,0x11,0x40,0xa6,0xdd,0x31,0x24,0x00,0x1e,0x91,0x45,0x1a,0x2c,0xad,0x34,0x54,0x95,0x93,0x65,0x6d,0x88,0x6e,0xbf};
    sm2_fp_from_bytes(a, a83);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c83, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a84[32] = {0x1c,0xa9,0x24,0xa1,0xa9,0xb9,0xe5,0xeb,0x2a,0x2e,0x75,0x04,0xc8,0xf1,0xbb,0x2c,0x17,0x42,0x89,0xc4,0xa6,0x70,0xd3,0xe7,0xfa,0x92,0x83,0xae,0xc4,0xf0,0x81,0x19};
    static std::uint8_t c84[32] = {0x73,0x2b,0x93,0x2c,0x51,0xf7,0x55,0xfc,0x9c,0x26,0x76,0xaf,0xa4,0xd4,0x2a,0xe8,0x79,0x71,0x69,0x88,0x85,0xcd,0x09,0xd0,0x9f,0x2d,0x45,0x9c,0xc7,0xd6,0x96,0xe0};
    sm2_fp_from_bytes(a, a84);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c84, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a85[32] = {0xc0,0xaf,0xd1,0xe8,0xc9,0x7e,0x1a,0x42,0x91,0xdb,0x66,0xc6,0x9d,0x21,0xc8,0x8b,0x2f,0xd2,0x49,0x65,0x33,0xb3,0x6d,0x11,0xc1,0x62,0x51,0xf0,0x24,0xc9,0x4c,0x9d};
    static std::uint8_t c85[32] = {0x36,0xd3,0xc8,0x0c,0x10,0xa8,0x5b,0x27,0xab,0xfe,0xd6,0xae,0x23,0xa4,0x82,0xc0,0xbf,0x53,0x64,0x2c,0x0b,0x90,0x29,0x5d,0xbb,0x74,0xc6,0xe0,0x71,0xcb,0x99,0x85};
    sm2_fp_from_bytes(a, a85);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c85, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a86[32] = {0x66,0x3c,0xfd,0x2f,0x52,0x78,0x27,0x00,0x5f,0x7b,0x89,0x51,0xd8,0x82,0xfc,0x8f,0x8f,0xbd,0xc9,0x39,0x56,0x85,0x04,0x0d,0xac,0x6d,0x96,0x76,0xd5,0xb0,0x8b,0xc1};
    static std::uint8_t c86[32] = {0x1a,0x59,0x71,0xe3,0xd4,0xca,0x04,0x8e,0xf0,0x3d,0x86,0x22,0xfc,0x83,0xd0,0x19,0x26,0xe7,0x66,0xd3,0x9a,0xb1,0x78,0xdc,0xa6,0xb2,0xba,0x5c,0xc7,0x9d,0xd8,0x89};
    sm2_fp_from_bytes(a, a86);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c86, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a87[32] = {0x99,0x79,0x0e,0x32,0x76,0xf2,0xb2,0x6a,0x73,0x6d,0x06,0x53,0xe1,0xf7,0x9f,0xbc,0xfb,0x8b,0x87,0x38,0x4b,0x0a,0xca,0x13,0x0f,0x1a,0x99,0xd0,0x32,0x26,0xf1,0x2f};
    static std::uint8_t c87[32] = {0x75,0x22,0x39,0x26,0xb1,0x71,0xe8,0x0b,0xc0,0xdb,0x25,0xeb,0xad,0xe1,0x46,0x8c,0xdb,0x89,0x22,0x37,0x75,0x34,0xba,0x35,0x0f,0xf4,0x90,0xd4,0x7e,0xf0,0xc6,0xce};
    sm2_fp_from_bytes(a, a87);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c87, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a88[32] = {0x32,0x79,0xd1,0x58,0xbc,0xfc,0x77,0xd1,0x43,0x96,0xa0,0x51,0xac,0xff,0x88,0x72,0x1f,0x1e,0x8e,0xf5,0x2c,0x60,0xa8,0xab,0x01,0x01,0xda,0x6f,0x75,0x9c,0x77,0x82};
    static std::uint8_t c88[32] = {0x89,0x5f,0x9b,0x6c,0x47,0x5e,0xca,0x9f,0x95,0x23,0xc6,0x64,0x87,0x71,0xd6,0x42,0x70,0xa8,0xad,0xcf,0x53,0x73,0x9a,0x99,0xd7,0x0c,0x5d,0x73,0x20,0x71,0x39,0x0d};
    sm2_fp_from_bytes(a, a88);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c88, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a89[32] = {0xc1,0x65,0xd4,0xb7,0x08,0x03,0x2b,0x17,0x52,0xcd,0x29,0xa5,0x67,0x22,0x55,0x9b,0x18,0xf4,0xe6,0x59,0x28,0x62,0x9a,0x43,0x9d,0x76,0xb1,0x89,0xe2,0x40,0x47,0x2e};
    static std::uint8_t c89[32] = {0xb1,0x9e,0x54,0xf6,0xe1,0xb1,0x02,0x78,0xcf,0xce,0xc1,0x6b,0xa8,0x3b,0xac,0x62,0xae,0x21,0x81,0xb9,0x46,0x07,0xc8,0x50,0xbd,0x77,0xc1,0x29,0xdc,0xc4,0xa6,0xaa};
    sm2_fp_from_bytes(a, a89);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c89, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a90[32] = {0x23,0xf6,0x42,0x82,0x7d,0x16,0x90,0x92,0xd8,0x27,0x41,0x46,0x64,0x90,0x24,0xe3,0x2a,0x24,0x34,0x8d,0xc4,0xc3,0x20,0xc4,0xdd,0x20,0x31,0x3a,0x4e,0x8d,0x06,0xdb};
    static std::uint8_t c90[32] = {0xcd,0x4e,0xaa,0x37,0x3d,0xb6,0x21,0xf4,0x56,0xf4,0xb7,0x43,0x62,0xba,0x4f,0x0d,0xd7,0xbd,0x83,0xc3,0x26,0x3a,0xe6,0xa2,0xfc,0xff,0x1e,0x8e,0xa5,0x4a,0xe4,0xd4};
    sm2_fp_from_bytes(a, a90);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c90, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a91[32] = {0x6a,0x88,0x1e,0x52,0xe5,0x9f,0x1a,0xed,0xf5,0xfe,0xf3,0xca,0x0c,0x77,0x6d,0x8f,0xb6,0x47,0x2a,0x69,0x99,0x39,0x00,0x0c,0xf2,0x37,0xea,0x34,0x4d,0x3a,0xe7,0x8d};
    static std::uint8_t c91[32] = {0x38,0x4f,0x07,0xad,0xbc,0xe2,0xf3,0x12,0x23,0x01,0x06,0x60,0x2d,0x53,0x17,0xd0,0x15,0xb5,0xe7,0x5d,0x42,0x57,0xd8,0xaf,0xa4,0x89,0x60,0xb4,0x57,0xf1,0x8a,0x87};
    sm2_fp_from_bytes(a, a91);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c91, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a92[32] = {0x02,0x8a,0xf2,0xe7,0xe7,0x67,0x18,0x8d,0xb4,0x2a,0x89,0xcd,0x06,0x56,0xbc,0xff,0xf3,0xe6,0xf2,0xde,0xb9,0x72,0x9c,0xb7,0x43,0x5b,0xed,0xd1,0x62,0x03,0xc2,0xc9};
    static std::uint8_t c92[32] = {0x63,0x69,0x36,0x7a,0x23,0xde,0x64,0x83,0x60,0xa0,0x41,0xb3,0x85,0xea,0x94,0x26,0xbd,0x4f,0xd2,0x84,0x6f,0x7c,0x82,0xfe,0x38,0xa7,0x56,0xa8,0x53,0xae,0xbd,0x1c};
    sm2_fp_from_bytes(a, a92);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c92, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a93[32] = {0x61,0x54,0x27,0x57,0xd8,0x81,0x0a,0x74,0x1e,0xf3,0xa4,0x50,0xce,0x36,0x73,0xa8,0x74,0x15,0x33,0x3b,0xb8,0xb9,0xca,0x84,0x20,0x6b,0xdf,0xf2,0x5b,0xd4,0x8d,0x25};
    static std::uint8_t c93[32] = {0xe0,0x14,0x60,0x5c,0xe2,0x6e,0x87,0xda,0x3f,0x4d,0x66,0x1d,0xcd,0xa9,0xe1,0xf8,0xe5,0x98,0x64,0xc2,0x03,0xc5,0x51,0xe4,0xf3,0x32,0xf9,0xc9,0xae,0x4a,0xb0,0x96};
    sm2_fp_from_bytes(a, a93);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c93, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a94[32] = {0x0a,0x7a,0xa5,0xb6,0x19,0x44,0x60,0xea,0x02,0x07,0xeb,0x83,0x76,0x9e,0x6a,0xd1,0x57,0x5a,0x17,0x71,0x7a,0xae,0xe2,0xd6,0x52,0x23,0xc7,0xcc,0xed,0x27,0x1a,0xbe};
    static std::uint8_t c94[32] = {0xd4,0x31,0x77,0x50,0x7e,0x81,0x61,0x99,0x4e,0xb6,0xb7,0xe8,0x44,0xf0,0x31,0x14,0x9e,0x8c,0x9f,0xf5,0xdc,0xec,0xac,0xbe,0x1e,0x30,0x5c,0x83,0x34,0x10,0x94,0x6e};
    sm2_fp_from_bytes(a, a94);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c94, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a95[32] = {0x37,0xbc,0xb2,0x93,0x74,0x53,0x2d,0x7c,0xec,0xdb,0x7e,0x09,0xbd,0xe2,0xc4,0xe8,0x3a,0x24,0x2f,0x83,0xa1,0xed,0x89,0xa2,0x87,0x6d,0x81,0x60,0x6d,0x29,0xbd,0x4d};
    static std::uint8_t c95[32] = {0x10,0x73,0x6a,0xa5,0x4d,0xba,0x53,0x86,0x8c,0x08,0x5f,0xe3,0x53,0x48,0xb0,0xc4,0xc4,0x88,0xf4,0x04,0x93,0x42,0xe4,0x8d,0x4d,0x13,0xc2,0xe2,0x83,0xa8,0xf2,0xff};
    sm2_fp_from_bytes(a, a95);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c95, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a96[32] = {0xb0,0x23,0x51,0xfe,0xc7,0xd5,0x0c,0x09,0xa6,0xf1,0xa9,0x75,0x2c,0x28,0x0e,0xce,0x06,0x75,0xcb,0xb6,0x12,0x86,0x96,0xa3,0x05,0x80,0x34,0xce,0x5a,0xab,0xc1,0x49};
    static std::uint8_t c96[32] = {0xa3,0xbc,0x1a,0x0d,0x91,0x59,0xff,0x48,0xac,0xf8,0x98,0x44,0xd3,0xfa,0x30,0xb8,0x22,0xf4,0xe4,0xe4,0xe4,0x25,0xe7,0x2e,0xf2,0x60,0x6a,0xcf,0x73,0x9a,0xdc,0xe9};
    sm2_fp_from_bytes(a, a96);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c96, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a97[32] = {0x62,0x78,0x39,0xca,0x96,0x22,0x13,0x84,0x93,0x1c,0x18,0xed,0xc5,0x7f,0x5c,0x2a,0x9a,0x0e,0xf8,0x86,0x39,0x9a,0x0a,0xc5,0x88,0xc6,0x5e,0xb9,0xef,0x6d,0x74,0xa7};
    static std::uint8_t c97[32] = {0xea,0xa4,0xe4,0x71,0xd8,0xcf,0x29,0xcd,0x55,0xf0,0xb8,0x2b,0xb2,0xde,0x19,0xa4,0xa0,0x7b,0xda,0x5f,0x3e,0xc1,0x5d,0xf8,0x74,0xe3,0x9c,0xaa,0x8e,0x06,0xf5,0x70};
    sm2_fp_from_bytes(a, a97);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c97, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a98[32] = {0x57,0x58,0xa9,0xdc,0x5d,0xb0,0x6d,0xd4,0x67,0x4a,0xd2,0x2f,0x25,0x5a,0x50,0x38,0xd7,0x94,0x4a,0x63,0x9e,0x06,0xb8,0xbd,0xb6,0x45,0x5d,0x26,0x8c,0x7f,0x33,0x95};
    static std::uint8_t c98[32] = {0x26,0x88,0x34,0xd2,0xda,0xd1,0x93,0x00,0x5e,0xa2,0x1f,0xf7,0x23,0x7b,0xcf,0x72,0x4b,0x15,0x4b,0xfa,0x67,0x0b,0x85,0x20,0x44,0xe2,0xbb,0x55,0x4d,0xd3,0x5d,0x98};
    sm2_fp_from_bytes(a, a98);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c98, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }

    static std::uint8_t a99[32] = {0xd1,0xcd,0x7e,0xf6,0xaa,0xd5,0xa2,0xe2,0x7a,0x51,0xd5,0xe4,0xa3,0x35,0xaa,0x2c,0x5a,0xf3,0xea,0xbe,0x94,0xc6,0xe7,0x35,0x35,0x9f,0x7f,0x7e,0xc2,0xed,0xd0,0xa1};
    static std::uint8_t c99[32] = {0xad,0xd3,0x0e,0x73,0xb9,0x88,0xe6,0x3f,0xac,0x8d,0x25,0xa2,0xcd,0x93,0x54,0x00,0xe2,0xcb,0x58,0xd5,0xea,0xec,0x7a,0xdf,0x21,0xa3,0xb8,0x06,0x25,0x58,0x6d,0x8d};
    sm2_fp_from_bytes(a, a99);
    sm2_fp_sqr(c, a);
    sm2_fp_to_bytes(c_data, c);
    if (std::memcmp(c99, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fp_sqr");
    }
}